package com.yamed.bus.dal.dao;

import com.yamed.bus.dal.entity.PromoteIpCount;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;


@Mapper
public interface PromoteIpCountDao {

    /**
     * 保存记录
     * @param promoteIpCount
     * @return
     */
    Integer saveRecord(PromoteIpCount promoteIpCount);

    PromoteIpCount getPromoteIpCount(@Param("refId") Long refId, @Param("ipAddress") String ipAddress);

//    List<PromoteApkConfig> getList(@Param("linkName") String linkName, @Param("promoteCode") String promoteCode);

    /**
     * 递增ip在该链接的访问次数
     * @param refId
     * @return
     */
    Integer addClickCount(@Param("refId") Long refId, @Param("ipAddress") String ipAddress);

    /**
     * ip在该链接的下载次数
     * @param refId
     * @return
     */
    Integer addDownloadCount(@Param("refId") Long refId, @Param("ipAddress") String ipAddress);

    /**
     * 查询所有的ip访问记录
     * @param map
     * @return
     */
    List<PromoteIpCount> getAllIpList(Map map);
}
